//生成uuid
export function getUuid() {
    function S4() {
        return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
    }
    return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
}

export function deepCopyObj(object) {
    if (!object || typeof object !== "object") {
        return;
    };
    let newObj = Array.isArray(object) ? [] : {};
    for (let item in object) {
        if (object.hasOwnProperty(item)) {
            newObj[item] = typeof object[item] === "object" ?
                deepCopyObj(object[item]) :
                object[item];
        }
    }
    newObj.uuid=getUuid();
    return newObj;
}